package com.cn.springcloudwechat.mapper.mapper;

import com.cn.springcloudwechat.common.mybatis.Page;
import com.cn.springcloudwechat.model.YmUserPoint;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface YmUserPointMapper {
    int deleteByPrimaryKey(Long pointId);

    int insert(YmUserPoint record);

    /**
     * 新增用户豆豆
     * @param record
     * @return
     */
    int insertSelective(YmUserPoint record);

    YmUserPoint selectByPrimaryKey(Long pointId);

    int updateByPrimaryKeySelective(YmUserPoint record);

    int updateByPrimaryKey(YmUserPoint record);


    /**
     * 豆豆明细
     * @param userId
     * @return
     */
    List<YmUserPoint> getPoint(@Param("userId") Long userId,@Param("page") Page<YmUserPoint> page);

    /**
     * 上传头像或注册次数
     * @param changeType
     * @param userId
     * @return
     */
    Integer getNumberOfPieces(@Param("changeType") Integer changeType,@Param("userId") Long userId);

    /**
     * 查询用户最新一条豆豆记录
     * @param userId
     * @return
     */
    YmUserPoint getNewestPoint(Long userId);

}